package com.ruoyi.web.controller.combat.camera;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.combat.domain.camera.CombatCameraGeoResult;
import com.ruoyi.combat.service.camera.ICombatCameraGeoResultService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 图像定位结果Controller
 * 
 * @author ruoyi
 * @date 2025-03-13
 */
@Api(tags = "课题六：图像定位结果管理")
@RestController
@RequestMapping("/combat/geoResult")
public class CombatCameraGeoResultController extends BaseController
{
    @Autowired
    private ICombatCameraGeoResultService combatCameraGeoResultService;

    /**
     * 查询图像定位结果列表
     */
    @ApiOperation("查询图像定位结果列表")
    @PreAuthorize("@ss.hasPermi('combat:geoResult:list')")
    @GetMapping("/list")
    public TableDataInfo list(CombatCameraGeoResult combatCameraGeoResult)
    {
        startPage();
        List<CombatCameraGeoResult> list = combatCameraGeoResultService.selectCombatCameraGeoResultList(combatCameraGeoResult);
        return getDataTable(list);
    }

    /**
     * 导出图像定位结果列表
     */
    @ApiOperation("导出图像定位结果列表")
    @PreAuthorize("@ss.hasPermi('combat:geoResult:export')")
    @Log(title = "图像定位结果", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, CombatCameraGeoResult combatCameraGeoResult)
    {
        List<CombatCameraGeoResult> list = combatCameraGeoResultService.selectCombatCameraGeoResultList(combatCameraGeoResult);
        ExcelUtil<CombatCameraGeoResult> util = new ExcelUtil<CombatCameraGeoResult>(CombatCameraGeoResult.class);
        util.exportExcel(response, list, "图像定位结果数据");
    }

    /**
     * 获取图像定位结果详细信息
     */
    @ApiOperation("获取图像定位结果详细信息")
    @PreAuthorize("@ss.hasPermi('combat:geoResult:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(combatCameraGeoResultService.selectCombatCameraGeoResultById(id));
    }

    /**
     * 新增图像定位结果
     */
    @PreAuthorize("@ss.hasPermi('combat:geoResult:add')")
    @Log(title = "图像定位结果", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody CombatCameraGeoResult combatCameraGeoResult)
    {
        return toAjax(combatCameraGeoResultService.insertCombatCameraGeoResult(combatCameraGeoResult));
    }

    /**
     * 修改图像定位结果
     */
    @PreAuthorize("@ss.hasPermi('combat:geoResult:edit')")
    @Log(title = "图像定位结果", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody CombatCameraGeoResult combatCameraGeoResult)
    {
        return toAjax(combatCameraGeoResultService.updateCombatCameraGeoResult(combatCameraGeoResult));
    }

    /**
     * 删除图像定位结果
     */
    @PreAuthorize("@ss.hasPermi('combat:geoResult:remove')")
    @Log(title = "图像定位结果", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(combatCameraGeoResultService.deleteCombatCameraGeoResultByIds(ids));
    }
}
